<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> -->
        <title>Chat Room</title>
</head>
<body>
<h1>Stock Price</h1>
<script type="text/javascript">
        
    function read_data() {
	var stream = new EventSource('/ticker');
	stream.onmessage = function(e){
	    console.log(e);
	    console.log(e.type);
	    document.getElementById('price').innerHTML=e.data;
	};

        stream.onerror = function(e){
	    console.log(e);
        };
    }

    read_data();
</script>
<p>Price:<span id="price"></span></p>
</body>

